<?php
/**
 * 首页管理model
 * author:ty
 * date:2018-2-1
 */
namespace App\Http\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;

class Index extends Model
{
    //轮播
    public static function carsouel($limit)
    {
        $page = null;
        if(!empty($limit)){
            $page= ' LIMIT '.$limit;
        }
        $sql_name = 'id, CONCAT('."'".COMMON::erp_img_path()."'".',`carousel_pic`) AS img';
        $res = DB::select('SELECT '.$sql_name.' FROM mzj_carousel WHERE carousel_status=1'.$page);
        return $res;
    }
}
